#ifndef __APP_DES_H__
#define __APP_DES_H__

#define DES_LONG unsigned long

typedef unsigned char DES_cblock[8];
typedef unsigned char const_DES_cblock[8];

typedef struct DES_ks
{
    union
    {
        DES_cblock cblock;

        DES_LONG deslong[2];
    } ks[16];
} DES_key_schedule;

#define DES_ENCRYPT	1
#define DES_DECRYPT	0

void DES_ecb_encrypt(DES_cblock *input,DES_cblock *output,
		     						 DES_key_schedule *ks,int enc);

void DES_encrypt1(DES_LONG *data,DES_key_schedule *ks, int enc);

void DES_encrypt2(DES_LONG *data,DES_key_schedule *ks, int enc);

void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1,
		  						DES_key_schedule *ks2, DES_key_schedule *ks3);
void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1,
		  						DES_key_schedule *ks2, DES_key_schedule *ks3);

void mid_DES_set_key_unchecked(DES_cblock *key,DES_key_schedule *schedule);
void mid_DES_ecb3_encrypt(DES_cblock *input, DES_cblock *output,
                      DES_key_schedule *ks1, DES_key_schedule *ks2,
                      DES_key_schedule *ks3, int enc);


/**
 * @brief CTCGetAuthInfo get encrypto authentication information
 *
 * @note  Modified from 'CTCGetAuthInfo' since subversion 1635
 *
 * @param nOutStr pointer to encrypto string of auth
 * @param nSize the size of nOutStr 
 *
 * @return pointer of nOut.  Mod.by Michael
 */
#endif
